package com.cxm.homework7.aspectJ.xml;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class UserAspect {
    public void myBefore(JoinPoint joinPoint){
        System.out.println("my before");
    }

    public void myAfterReturning(JoinPoint joinPoint){
        System.out.println("my after-returning");
    }

    public void myAfter(JoinPoint joinPoint){
        System.out.println("my after");
    }

    public Object myAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("around-before");
        Object obj = proceedingJoinPoint.proceed();
        System.out.println("around-after");
        return obj;
    }

    public void myAfterThrow(JoinPoint joinPoint,Throwable e){
        System.out.println("have exception" + e.getMessage());
    }
}
